#define  RCC_APB2ENR   (0x40021000+0x18)

#define GPIOA_Base	0x40010800
#define GPIOA_CRH_OFFSET 0x04	
#define GPIOA_CRH		(GPIOA_Base+GPIOA_CRH_OFFSET)

#define GPIOA_ODR   (GPIOA_Base+0x0c)

void delay(int x)
{
	while(x--)
	{}
}

int main(void)
{
	
	unsigned int *p_GPIOA_CRH=( unsigned int *  )GPIOA_CRH;
	unsigned int *p_RCC_APB2ENR=(unsigned int *)RCC_APB2ENR;
	unsigned int *p_GPIOA_ODR =(unsigned int *)GPIOA_ODR;
	unsigned int a,b,c;

	a=1;
	b=2;
	c=3;
	*p_RCC_APB2ENR |= 1<<2;
	
	// 0x000000f0            B =  000000 1111 0000
	// 0XFFFFFF0F  PORTa9    7654
	*p_GPIOA_CRH &=   ~(0x000000f0 );
	*p_GPIOA_CRH |= 0x00000030;  // PP 50M   0011

	while(1){
		
	*p_GPIOA_ODR |= 1<<9;
		delay(800000);
	
		
	*p_GPIOA_ODR &=   ~(1<<9);
		delay(800000);
		
	}
	
}
